package com.john.javacv.ffmpeg;

import java.awt.image.BufferedImage;
import java.io.Serializable;

/**
 * 从视频中捕捉截图结果返回Vo
 */
public class VideoCaptureImageResult implements Serializable {
    private BufferedImage image;
    private int needIndex;
    private int imageIndex;
    private boolean hasNext = false;

    public VideoCaptureImageResult() {
    }

    public VideoCaptureImageResult(BufferedImage image, int needIndex, int imageIndex, boolean hasNext) {
        this.image = image;
        this.needIndex = needIndex;
        this.imageIndex = imageIndex;
        this.hasNext = hasNext;
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public int getNeedIndex() {
        return needIndex;
    }

    public void setNeedIndex(int needIndex) {
        this.needIndex = needIndex;
    }

    public int getImageIndex() {
        return imageIndex;
    }

    public void setImageIndex(int imageIndex) {
        this.imageIndex = imageIndex;
    }

    /**
     * 是否有下一个帧可取
     * @return true有，FALSE已经是最后的帧了。
     */
    public boolean isHasNext() {
        return hasNext;
    }

    public void setHasNext(boolean hasNext) {
        this.hasNext = hasNext;
    }

    @Override
    public String toString() {
        return "VideoCaptureImageResult{" +
                "needIndex=" + needIndex +
                ", imageIndex=" + imageIndex +
                ", hasNext=" + hasNext +
                ", image=" + image +
                '}';
    }
}
